package routers

import (
	"gitee.com/wao520/obtain_data/controllers"

	"github.com/gin-gonic/gin"
)

func RoutersInit(r *gin.Engine) {
	//文章路由部分
	article_r := r.Group("/article/")
	{
		//获取一篇文章详情
		article_c := controllers.NewArticleController()
		article_r.GET("/getone/:id", article_c.GetOne)
	}
	//小说路由部分
	novels_r := r.Group("/novels/")
	{
		//获取一篇小说详情
		novels_c := controllers.NewNovelsController()
		novels_r.GET("/getone/:id", novels_c.GetOne)
	}
	//商品路由部分
	goods_r := r.Group("/goods/")
	{
		//上锁-减库存-解锁
		goods_c := controllers.NewGoodsController()
		goods_r.GET("/lockbuyone", goods_c.LockBuyOne)
	}
}
